﻿//JumbotCms_4.1 Final
using System;
using System.Data;
using System.Web;
using System.IO;
using JumbotCms.Common;
namespace JumbotCms.WebFile.Admin
{
    public partial class _mail_service : JumbotCms.API.AdminCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            Admin_Load("0000", "html");
            if (!Page.IsPostBack)
            {
                string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/mail.config");
                Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
                string _ServiceAddress = XmlTool.GetText("Mails/Service/Address");
                string _ServiceNickName = XmlTool.GetText("Mails/Service/NickName");
                this.txtServiceAddress.Text = _ServiceAddress;
                this.txtServiceNickName.Text = _ServiceNickName;
                XmlTool.Dispose();
            }
        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            string strXmlFile = HttpContext.Current.Server.MapPath("~/_data/config/mail.config");
            Jumbot.DataOper.XmlControl XmlTool = new Jumbot.DataOper.XmlControl(strXmlFile);
            XmlTool.Update("Mails/Service/Address", this.txtServiceAddress.Text);
            XmlTool.Update("Mails/Service/NickName", this.txtServiceNickName.Text);
            XmlTool.Save();
            XmlTool.Dispose();
            FinalMessage("保存成功!", "service.aspx", 0);
        }
    }
}
